﻿using System;
using System.Collections.Generic;
using DefaultConnection;
using MementoLibrary.DTOs;

namespace MementoWeb.Models
{
    public interface IDataRepository
    {
        void CreateNewCategory(Category category);
        void DeleteCategory( int id );
        Category GetCategoryById(int id);
        IEnumerable<Category> GetAllCategories();
        IEnumerable<Category> GetCategoriesByCategoryGroupId(int id);
        void SaveCategoryChanges(Category category);

        void CreateNewCategoryGroup(CategoryGroup categoryGroup);
        void DeleteCategoryGroup( int id );
        CategoryGroup GetCategoryGroupById(int id);
        IEnumerable<CategoryGroup> GetAllCategoryGroups();
        void SaveCategoryGroupChanges(CategoryGroup categoryGroup);

        void CreateNewPerson(Person person);
        void DeletePerson( int id );
        Person GetPersonById(int id);
        void SavePersonChanges(Person person);
        int GetOrCreatePersonId(string domainUserName);

        void CreateNewProject( Project project );
        void DeleteProject( int id );
        Project GetProjectById( int id );
        IEnumerable<Project> GetAllProjects();
        void SaveProjectChanges( Project project );
        int CreateOrUpdateProject(MementoLibrary.DTOs.ProjectDTO project);

        void CreateNewTask( Task task );
        void DeleteTask( int id );
        Task GetTaskById( int id );
        IEnumerable<Task> GetAllTasks();
        void SaveTaskChanges( Task task );
        int CreateOrUpdateTask(MementoLibrary.DTOs.TaskDTO task, int projectID);

        void CreateNewWorkCategory( WorkCategory workCategory );
        void DeleteWorkCategory( int id );
        WorkCategory GetWorkCategoryById( int id );
        IEnumerable<WorkCategory> GetAllWorkCategories();
        void SaveWorkCategoryChanges( WorkCategory workCategory );
        void BulkCreateWorkCategories(int worklogID, IEnumerable<int> categoryIDs);

        int CreateNewWorkLog(WorkLog workLog);
        void DeleteWorkLog(int id);
        WorkLog GetWorkLogById(int id);
        IEnumerable<WorkLog> GetAllWorkLogs();
        IEnumerable<WorkLogDTO> GetWorklogsForUserByDateRange(int personID, DateTime from, DateTime to);
        void SaveWorkLogChanges(WorkLog workLog);

        IEnumerable<WorkLogReportItem> ReportWorkLoggedByCategory(DateTime? from, DateTime? to, int personId, int projectId);
    }
}
